

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/fluid.png">
  <link rel="icon" href="/img/fluid.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="深海火锅店">
  <meta name="keywords" content="">
  
    <meta name="description" content="Servlet 项目创建    删掉pom.xml        点击运行即可     因为没有页面     在WEB-INF下新建lib包，在lib下存放jar包    此时依赖还没完全导入，还需如下操作     选择lib，此时就算导入成功了    网上copy一个jdbc的工具包  1234567891011121314151617181920212223242526272829303132">
<meta property="og:type" content="article">
<meta property="og:title" content="jsp复习">
<meta property="og:url" content="http://example.com/2023/03/24/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80/%E6%A8%A1%E6%9D%BF%E8%AF%AD%E8%A8%80/Jsp/Jsp/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="Servlet 项目创建    删掉pom.xml        点击运行即可     因为没有页面     在WEB-INF下新建lib包，在lib下存放jar包    此时依赖还没完全导入，还需如下操作     选择lib，此时就算导入成功了    网上copy一个jdbc的工具包  1234567891011121314151617181920212223242526272829303132">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222125366.png">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222127960.png">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222132185.png">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222132497.png">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222133344.png">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222133936.png">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222133445.png">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222134032.png">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222134753.png">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222136177.png">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222136111.png">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222139162.png">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222140082.png">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222140175.png">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222141981.png">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222154368.png">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222155920.png">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222200659.png">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222206576.png">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222204889.png">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222205247.png">
<meta property="og:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303230741695.png">
<meta property="article:published_time" content="2023-03-23T16:00:00.000Z">
<meta property="article:modified_time" content="2024-02-15T16:04:19.051Z">
<meta property="article:author" content="深海火锅店">
<meta property="article:tag" content="jsp">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222125366.png">
  
  
    <meta name="referrer" content="no-referrer-when-downgrade">
  
  
  <title>jsp复习 - Hexo</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
  




  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"example.com","root":"/","version":"1.9.3","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml"};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
  


  
<meta name="generator" content="Hexo 6.3.0"></head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 70vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>Fluid</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('/img/background.jpg') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="jsp复习"></span>
          
        </div>

        
          
  <div class="mt-3">
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2023-03-24 00:00" pubdate>
          2023年3月24日 凌晨
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          6.3k 字
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          53 分钟
        
      </span>
    

    
    
  </div>


        
      </div>

      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      

    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">jsp复习</h1>
            
            
              <div class="markdown-body">
                
                <h2 id="Servlet"><a href="#Servlet" class="headerlink" title="Servlet"></a>Servlet</h2><blockquote>
<h3 id="项目创建"><a href="#项目创建" class="headerlink" title="项目创建"></a>项目创建</h3></blockquote>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222125366.png" srcset="/img/loading.gif" lazyload alt="项目创建"></p>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222127960.png" srcset="/img/loading.gif" lazyload alt="配置1"></p>
<blockquote>
<p>删掉pom.xml</p>
</blockquote>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222132185.png" srcset="/img/loading.gif" lazyload alt="image-20230322213236109"></p>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222132497.png" srcset="/img/loading.gif" lazyload alt="image-20230322213258427"></p>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222133344.png" srcset="/img/loading.gif" lazyload alt="image-20230322213314271"></p>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222133936.png" srcset="/img/loading.gif" lazyload alt="image-20230322213335864"></p>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222133445.png" srcset="/img/loading.gif" lazyload alt="image-20230322213347376"></p>
<blockquote>
<p>点击运行即可</p>
</blockquote>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222134032.png" srcset="/img/loading.gif" lazyload alt="image-20230322213425998"></p>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222134753.png" srcset="/img/loading.gif" lazyload alt="image-20230322213433714"></p>
<blockquote>
<p>因为没有页面</p>
</blockquote>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222136177.png" srcset="/img/loading.gif" lazyload alt="image-20230322213617014"></p>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222136111.png" srcset="/img/loading.gif" lazyload alt="image-20230322213631081"></p>
<blockquote>
<p>在WEB-INF下新建lib包，在lib下存放jar包</p>
</blockquote>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222139162.png" srcset="/img/loading.gif" lazyload alt="image-20230322213928118"></p>
<blockquote>
<p>此时依赖还没完全导入，还需如下操作</p>
</blockquote>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222140082.png" srcset="/img/loading.gif" lazyload alt="image-20230322214007002"></p>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222140175.png" srcset="/img/loading.gif" lazyload alt="image-20230322214026141"></p>
<blockquote>
<p>选择lib，此时就算导入成功了</p>
</blockquote>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222141981.png" srcset="/img/loading.gif" lazyload alt="image-20230322214102932"></p>
<blockquote>
<p>网上copy一个jdbc的工具包</p>
</blockquote>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">package</span> com.example.util;<br><br><span class="hljs-keyword">import</span> org.apache.commons.beanutils.BeanUtils;<br><br><span class="hljs-keyword">import</span> java.lang.reflect.Field;<br><span class="hljs-keyword">import</span> java.sql.*;<br><span class="hljs-keyword">import</span> java.util.ArrayList;<br><span class="hljs-keyword">import</span> java.util.List;<br><br><span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">JDBCUtil</span> &#123;<br><br>    <span class="hljs-comment">//1.加载驱动</span><br>    <span class="hljs-keyword">static</span> &#123;<br>        <span class="hljs-keyword">try</span> &#123;<br>            Class.forName(<span class="hljs-string">&quot;com.mysql.jdbc.Driver&quot;</span>);<br>        &#125; <span class="hljs-keyword">catch</span> (ClassNotFoundException e) &#123;<br>            <span class="hljs-comment">// TODO Auto-generated catch block</span><br>            e.printStackTrace();<br>        &#125;<br>    &#125;<br><br>    <span class="hljs-comment">//2.获取连接</span><br>    <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> Connection <span class="hljs-title function_">getConnection</span><span class="hljs-params">()</span> &#123;<br><br>        <span class="hljs-type">Connection</span> <span class="hljs-variable">conn</span> <span class="hljs-operator">=</span> <span class="hljs-literal">null</span>;<br>        <span class="hljs-keyword">try</span> &#123;<br>            conn = DriverManager.getConnection(<span class="hljs-string">&quot;jdbc:mysql://localhost:3306/xiaoy&quot;</span>, <span class="hljs-string">&quot;root&quot;</span>, <span class="hljs-string">&quot;mysql&quot;</span>);<br>        &#125; <span class="hljs-keyword">catch</span> (SQLException e) &#123;<br>            e.printStackTrace();<br>        &#125;<br>        <span class="hljs-keyword">return</span> conn;<br>    &#125;<br><br>    <span class="hljs-comment">//3.关闭连接</span><br>    <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">close</span><span class="hljs-params">(Connection conn, Statement st, ResultSet rs)</span> &#123;<br>        <span class="hljs-comment">//关闭连接</span><br>        <span class="hljs-keyword">if</span> (conn != <span class="hljs-literal">null</span>) &#123;<br>            <span class="hljs-keyword">try</span> &#123;<br>                conn.close();<br>            &#125; <span class="hljs-keyword">catch</span> (SQLException e) &#123;<br>                <span class="hljs-comment">// TODO Auto-generated catch block</span><br>                e.printStackTrace();<br>            &#125;<br>        &#125;<br>        <span class="hljs-comment">//关闭statement</span><br>        <span class="hljs-keyword">if</span> (st != <span class="hljs-literal">null</span>) &#123;<br>            <span class="hljs-keyword">try</span> &#123;<br>                st.close();<br>            &#125; <span class="hljs-keyword">catch</span> (SQLException e) &#123;<br>                <span class="hljs-comment">// TODO Auto-generated catch block</span><br>                e.printStackTrace();<br>            &#125;<br>        &#125;<br>        <span class="hljs-comment">//关闭结果集</span><br>        <span class="hljs-keyword">if</span> (rs != <span class="hljs-literal">null</span>) &#123;<br>            <span class="hljs-keyword">try</span> &#123;<br>                rs.close();<br>            &#125; <span class="hljs-keyword">catch</span> (SQLException e) &#123;<br>                <span class="hljs-comment">// TODO Auto-generated catch block</span><br>                e.printStackTrace();<br>            &#125;<br>        &#125;<br>    &#125;<br><br>    <span class="hljs-comment">//-------------------------------封装sql操作------------------------------</span><br>    <span class="hljs-comment">//查询返回List集合</span><br>    <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> &lt;T&gt; List&lt;T&gt; <span class="hljs-title function_">getList</span><span class="hljs-params">(Class&lt;T&gt; cls, String sql, Object... obj)</span> &#123;<br><br>        <span class="hljs-type">Connection</span> <span class="hljs-variable">conn</span> <span class="hljs-operator">=</span> <span class="hljs-literal">null</span>;<br>        <span class="hljs-type">PreparedStatement</span> <span class="hljs-variable">ps</span> <span class="hljs-operator">=</span> <span class="hljs-literal">null</span>;<br>        <span class="hljs-type">ResultSet</span> <span class="hljs-variable">rs</span> <span class="hljs-operator">=</span> <span class="hljs-literal">null</span>;<br><br>        <span class="hljs-keyword">try</span> &#123;<br>            <span class="hljs-comment">//1.获取连接</span><br>            conn = getConnection();<br>            <span class="hljs-comment">//2.获取预处理对象</span><br>            ps = conn.prepareStatement(sql);<br>            <span class="hljs-comment">//循环参数，如果没有就不走这里</span><br>            <span class="hljs-keyword">for</span> (<span class="hljs-type">int</span> <span class="hljs-variable">i</span> <span class="hljs-operator">=</span> <span class="hljs-number">1</span>; i &lt;= obj.length; i++) &#123;<br>                <span class="hljs-comment">//注意：数组下标从0开始，预处理参数设置从1开始</span><br>                ps.setObject(i, obj[i - <span class="hljs-number">1</span>]);<br>            &#125;<br>            <span class="hljs-comment">//3.执行SQL语句</span><br>            System.out.println(sql);<br>            rs = ps.executeQuery();<br>            <span class="hljs-comment">//4.遍历结果集</span><br>            <span class="hljs-comment">//遍历之前准备：因为封装不知道未来会查询多少列，所以我们需要指定有多少列</span><br>            <span class="hljs-comment">//获取ResultSet对象的列编号、类型和属性</span><br>            <span class="hljs-type">ResultSetMetaData</span> <span class="hljs-variable">date</span> <span class="hljs-operator">=</span> rs.getMetaData();<br>            <span class="hljs-comment">//获取列数</span><br>            <span class="hljs-type">int</span> <span class="hljs-variable">column</span> <span class="hljs-operator">=</span> date.getColumnCount();<br>            <span class="hljs-comment">//获取本类所有的属性</span><br>            Field[] fields = cls.getDeclaredFields();<br><br>            <span class="hljs-comment">//创建一个list集合对象来存储查询数据</span><br>            List&lt;T&gt; list = <span class="hljs-keyword">new</span> <span class="hljs-title class_">ArrayList</span>&lt;T&gt;();<br><br>            <span class="hljs-comment">//开始遍历结果集</span><br>            <span class="hljs-keyword">while</span> (rs.next()) &#123;<br><br>                <span class="hljs-comment">//创建类类型实例</span><br>                <span class="hljs-type">T</span> <span class="hljs-variable">t</span> <span class="hljs-operator">=</span> cls.newInstance();<br><br>                <span class="hljs-keyword">for</span> (<span class="hljs-type">int</span> <span class="hljs-variable">i</span> <span class="hljs-operator">=</span> <span class="hljs-number">1</span>; i &lt;= column; i++) &#123;<br>                    <span class="hljs-comment">//每一列的值</span><br>                    <span class="hljs-type">Object</span> <span class="hljs-variable">value</span> <span class="hljs-operator">=</span> rs.getObject(i);<br><br>                    <span class="hljs-comment">/**</span><br><span class="hljs-comment">                     *String columnName = date.getColumnName(i);//获取每一列名称</span><br><span class="hljs-comment">                     * 关于获取每一列名称，如果列取了别名的话，则不能用上面的方法取列的名称</span><br><span class="hljs-comment">                     * 用下面的方法</span><br><span class="hljs-comment">                     */</span><br>                    <span class="hljs-type">String</span> <span class="hljs-variable">columnName</span> <span class="hljs-operator">=</span> date.getColumnLabel(i);<span class="hljs-comment">//获取每一列名称（别名）</span><br><br>                    <span class="hljs-comment">//遍历所有属性对象</span><br>                    <span class="hljs-keyword">for</span> (Field field : fields) &#123;<br>                        <span class="hljs-comment">//获取属性名</span><br>                        <span class="hljs-type">String</span> <span class="hljs-variable">name</span> <span class="hljs-operator">=</span> field.getName();<br><br>                        field.setAccessible(<span class="hljs-literal">true</span>);<span class="hljs-comment">//打破封装，忽略对封装修饰符的检测</span><br><br>						<span class="hljs-comment">/*if (name.equals(columnName)) &#123;</span><br><span class="hljs-comment">                            //获取列类型名称</span><br><span class="hljs-comment">							String string = date.getColumnTypeName(i);</span><br><span class="hljs-comment"></span><br><span class="hljs-comment">							//如果列类型是Date类型，转换成字符串表现形式</span><br><span class="hljs-comment">							SimpleDateFormat sdf = new SimpleDateFormat(&quot;yyyy-MM-dd&quot;);</span><br><span class="hljs-comment">							String d = sdf.format(value);</span><br><span class="hljs-comment">							//赋值：将数据库中查询的字段赋值给对应名称的属性</span><br><span class="hljs-comment">							field.set(t, d);</span><br><span class="hljs-comment">						&#125;else&#123;</span><br><span class="hljs-comment">							field.set(t, value);</span><br><span class="hljs-comment">						&#125;*/</span><br><br>                        <span class="hljs-keyword">if</span> (name.equals(columnName)) &#123;<br>                            BeanUtils.copyProperty(t, name, value);<br>                            <span class="hljs-keyword">break</span>;<span class="hljs-comment">//增加效率，避免不必要的循环</span><br>                        &#125;<br>                    &#125;<br>                &#125;<br>                list.add(t);<br>            &#125;<br>            <span class="hljs-keyword">return</span> list;<br>            <span class="hljs-comment">//5.关闭连接</span><br>        &#125; <span class="hljs-keyword">catch</span> (Exception e) &#123;<br>            e.printStackTrace();<br>        &#125; <span class="hljs-keyword">finally</span> &#123;<br>            JDBCUtil.close(conn, ps, rs);<br>        &#125;<br>        <span class="hljs-keyword">return</span> <span class="hljs-literal">null</span>;<br>    &#125;<br><br>    <span class="hljs-comment">/**</span><br><span class="hljs-comment">     * 增加、删除、修改</span><br><span class="hljs-comment">     *</span><br><span class="hljs-comment">     * <span class="hljs-doctag">@param</span> sql sql语句</span><br><span class="hljs-comment">     * <span class="hljs-doctag">@param</span> obj 参数</span><br><span class="hljs-comment">     */</span><br>    <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-type">boolean</span> <span class="hljs-title function_">getDML</span><span class="hljs-params">(String sql, Object... obj)</span> &#123;<br><br>        <span class="hljs-type">Connection</span> <span class="hljs-variable">conn</span> <span class="hljs-operator">=</span> <span class="hljs-literal">null</span>;<br>        <span class="hljs-type">PreparedStatement</span> <span class="hljs-variable">ps</span> <span class="hljs-operator">=</span> <span class="hljs-literal">null</span>;<br><br>        <span class="hljs-keyword">try</span> &#123;<br>            conn = getConnection();<br>            ps = conn.prepareStatement(sql);<br><br>            <span class="hljs-keyword">for</span> (<span class="hljs-type">int</span> <span class="hljs-variable">i</span> <span class="hljs-operator">=</span> <span class="hljs-number">1</span>; i &lt;= obj.length; i++) &#123;<br>                ps.setObject(i, obj[i - <span class="hljs-number">1</span>]);<br>            &#125;<br>            System.out.println(sql);<br>            <span class="hljs-type">int</span> <span class="hljs-variable">update</span> <span class="hljs-operator">=</span> ps.executeUpdate();<br><br>            <span class="hljs-keyword">if</span> (update &gt; <span class="hljs-number">0</span>) &#123;<br>                <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>;<br>            &#125;<br>        &#125; <span class="hljs-keyword">catch</span> (Exception e) &#123;<br>            e.printStackTrace();<br>        &#125; <span class="hljs-keyword">finally</span> &#123;<br>            close(conn, ps, <span class="hljs-literal">null</span>);<br>        &#125;<br>        <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>;<br>    &#125;<br><br>    <span class="hljs-comment">//查询返回单个对象</span><br>    <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> &lt;T&gt; T <span class="hljs-title function_">getOneObject</span><span class="hljs-params">(Class&lt;T&gt; cls, String sql, Object... obj)</span> &#123;<br><br>        <span class="hljs-type">Connection</span> <span class="hljs-variable">conn</span> <span class="hljs-operator">=</span> <span class="hljs-literal">null</span>;<br>        <span class="hljs-type">PreparedStatement</span> <span class="hljs-variable">ps</span> <span class="hljs-operator">=</span> <span class="hljs-literal">null</span>;<br>        <span class="hljs-type">ResultSet</span> <span class="hljs-variable">rs</span> <span class="hljs-operator">=</span> <span class="hljs-literal">null</span>;<br><br>        <span class="hljs-keyword">try</span> &#123;<br>            <span class="hljs-comment">//1.获取连接</span><br>            conn = getConnection();<br>            <span class="hljs-comment">//2.获取预处理对象</span><br>            ps = conn.prepareStatement(sql);<br>            <span class="hljs-comment">//循环参数，如果没有就不走这里</span><br>            <span class="hljs-keyword">for</span> (<span class="hljs-type">int</span> <span class="hljs-variable">i</span> <span class="hljs-operator">=</span> <span class="hljs-number">1</span>; i &lt;= obj.length; i++) &#123;<br>                <span class="hljs-comment">//注意：数组下标从0开始，预处理参数设置从1开始</span><br>                ps.setObject(i, obj[i - <span class="hljs-number">1</span>]);<br>            &#125;<br>            <span class="hljs-comment">//3.执行SQL语句</span><br>            System.out.println(sql);<br>            rs = ps.executeQuery();<br>            <span class="hljs-comment">//4.遍历结果集</span><br>            <span class="hljs-comment">//遍历之前准备：因为封装不知道未来会查询多少列，所以我们需要指定有多少列</span><br>            <span class="hljs-comment">//获取ResultSet对象的列编号、类型和属性</span><br>            <span class="hljs-type">ResultSetMetaData</span> <span class="hljs-variable">date</span> <span class="hljs-operator">=</span> rs.getMetaData();<br>            <span class="hljs-comment">//获取列数</span><br>            <span class="hljs-type">int</span> <span class="hljs-variable">column</span> <span class="hljs-operator">=</span> date.getColumnCount();<br>            <span class="hljs-comment">//获取本类所有的属性</span><br>            Field[] fields = cls.getDeclaredFields();<br><br>            <span class="hljs-comment">//开始遍历结果集</span><br>            <span class="hljs-keyword">if</span> (rs.next()) &#123;<br><br>                <span class="hljs-comment">//创建类类型实例</span><br>                <span class="hljs-type">T</span> <span class="hljs-variable">t</span> <span class="hljs-operator">=</span> cls.newInstance();<br><br>                <span class="hljs-keyword">for</span> (<span class="hljs-type">int</span> <span class="hljs-variable">i</span> <span class="hljs-operator">=</span> <span class="hljs-number">1</span>; i &lt;= column; i++) &#123;<br>                    <span class="hljs-comment">//每一列的值</span><br>                    <span class="hljs-type">Object</span> <span class="hljs-variable">value</span> <span class="hljs-operator">=</span> rs.getObject(i);<br>                    <span class="hljs-comment">//获取每一列名称</span><br>                    <span class="hljs-type">String</span> <span class="hljs-variable">columnName</span> <span class="hljs-operator">=</span> date.getColumnName(i);<br><br>                    <span class="hljs-comment">//遍历所有属性对象</span><br>                    <span class="hljs-keyword">for</span> (Field field : fields) &#123;<br>                        <span class="hljs-comment">//获取属性名</span><br>                        <span class="hljs-type">String</span> <span class="hljs-variable">name</span> <span class="hljs-operator">=</span> field.getName();<br>                        <span class="hljs-comment">//打破封装，忽略对封装修饰符的检测</span><br>                        field.setAccessible(<span class="hljs-literal">true</span>);<br><br>                        <span class="hljs-keyword">if</span> (name.equals(columnName)) &#123;<br>                            BeanUtils.copyProperty(t, name, value);<br>                        &#125;<br>                    &#125;<br>                &#125;<br>                <span class="hljs-keyword">return</span> t;<br>            &#125;<br>            <span class="hljs-comment">//5.关闭连接</span><br>        &#125; <span class="hljs-keyword">catch</span> (Exception e) &#123;<br>            e.printStackTrace();<br>        &#125; <span class="hljs-keyword">finally</span> &#123;<br>            JDBCUtil.close(conn, ps, rs);<br>        &#125;<br>        <span class="hljs-keyword">return</span> <span class="hljs-literal">null</span>;<br>    &#125;<br><br>    <span class="hljs-comment">//查询总记录数</span><br>    <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> Integer <span class="hljs-title function_">getCount</span><span class="hljs-params">(String sql, Object... obj)</span> &#123;<br><br>        <span class="hljs-type">Connection</span> <span class="hljs-variable">conn</span> <span class="hljs-operator">=</span> <span class="hljs-literal">null</span>;<br>        <span class="hljs-type">PreparedStatement</span> <span class="hljs-variable">ps</span> <span class="hljs-operator">=</span> <span class="hljs-literal">null</span>;<br>        <span class="hljs-type">ResultSet</span> <span class="hljs-variable">rs</span> <span class="hljs-operator">=</span> <span class="hljs-literal">null</span>;<br><br>        <span class="hljs-keyword">try</span> &#123;<br>            <span class="hljs-comment">//1.获取连接</span><br>            conn = getConnection();<br>            <span class="hljs-comment">//2.获取预处理对象</span><br>            ps = conn.prepareStatement(sql);<br>            <span class="hljs-comment">//循环参数，如果没有就不走这里</span><br>            <span class="hljs-keyword">for</span> (<span class="hljs-type">int</span> <span class="hljs-variable">i</span> <span class="hljs-operator">=</span> <span class="hljs-number">1</span>; i &lt;= obj.length; i++) &#123;<br>                <span class="hljs-comment">//注意：数组下标从0开始，预处理参数设置从1开始</span><br>                ps.setObject(i, obj[i - <span class="hljs-number">1</span>]);<br>            &#125;<br>            <span class="hljs-comment">//3.执行SQL语句</span><br>            System.out.println(sql);<br>            rs = ps.executeQuery();<br><br>            <span class="hljs-comment">//开始遍历结果集</span><br>            <span class="hljs-keyword">if</span> (rs.next()) &#123;<br><br>                <span class="hljs-keyword">return</span> rs.getInt(<span class="hljs-number">1</span>);<br>            &#125;<br>            <span class="hljs-comment">//5.关闭连接</span><br>        &#125; <span class="hljs-keyword">catch</span> (Exception e) &#123;<br>            e.printStackTrace();<br>        &#125; <span class="hljs-keyword">finally</span> &#123;<br>            JDBCUtil.close(conn, ps, rs);<br>        &#125;<br>        <span class="hljs-keyword">return</span> <span class="hljs-literal">null</span>;<br>    &#125;<br>&#125;<br></code></pre></td></tr></table></figure>

<blockquote>
<p>BeanUtils需要导包，<code>commons-beanutils-1.9.4.jar</code></p>
</blockquote>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">dependency</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>commons-beanutils<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>commons-beanutils<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">version</span>&gt;</span>1.9.4<span class="hljs-tag">&lt;/<span class="hljs-name">version</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">dependency</span>&gt;</span><br></code></pre></td></tr></table></figure>

<blockquote>
<p>如果需要连接oracle，则jdbcUtil需要改改配置</p>
<p>导入jquery，使用ajax，<a target="_blank" rel="noopener" href="https://cdn.staticfile.org/jquery/1.12.4/jquery.min.js">下载网址</a></p>
</blockquote>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222154368.png" srcset="/img/loading.gif" lazyload alt="image-20230322215453085"></p>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222155920.png" srcset="/img/loading.gif" lazyload alt="image-20230322215530812"></p>
<blockquote>
<p>配置webservlet</p>
<p>我这里@WebServlet注解爆红，导入<code>javax.servlet-api-3.1.0.jar</code>包后解决<br>看到有博客说<code>servlet.jar</code>也可以，不过我就导入了<code>javax.servlet-api-3.1.0.jar</code>就已解决</p>
</blockquote>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222200659.png" srcset="/img/loading.gif" lazyload alt="image-20230322220056475"></p>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222206576.png" srcset="/img/loading.gif" lazyload alt="image-20230322220646463"></p>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222204889.png" srcset="/img/loading.gif" lazyload alt="image-20230322220429739"></p>
<blockquote>
<p>注释掉SubHandle内的<code>super.doPost(req, resp);</code>即可，<code>记得重启服务</code></p>
</blockquote>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303222205247.png" srcset="/img/loading.gif" lazyload alt="image-20230322220511121"></p>
<blockquote>
<h2 id="前端之前一直接受不到数据"><a href="#前端之前一直接受不到数据" class="headerlink" title="前端之前一直接受不到数据"></a>前端之前一直接受不到数据</h2><p>既不执行success也不执行error，是因为后端的返回格式不是json</p>
</blockquote>
<p><img src="https://gitee.com/tongstyle/blog-img/raw/master/img/202303230741695.png" srcset="/img/loading.gif" lazyload alt="image-20230323074135515"></p>

                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/categories/jsp/" class="category-chain-item">jsp</a>
  
  

      </span>
    
  
</span>

    </div>
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/tags/jsp/">#jsp</a>
      
    </div>
  
</div>


              
  

  <div class="license-box my-3">
    <div class="license-title">
      <div>jsp复习</div>
      <div>http://example.com/2023/03/24/编程语言/模板语言/Jsp/Jsp/</div>
    </div>
    <div class="license-meta">
      
        <div class="license-meta-item">
          <div>作者</div>
          <div>深海火锅店</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>发布于</div>
          <div>2023年3月24日</div>
        </div>
      
      
      
        <div class="license-meta-item">
          <div>许可协议</div>
          <div>
            
              
              
                <a target="_blank" href="https://creativecommons.org/licenses/by/4.0/">
                  <span class="hint--top hint--rounded" aria-label="BY - 署名">
                    <i class="iconfont icon-by"></i>
                  </span>
                </a>
              
            
          </div>
        </div>
      
    </div>
    <div class="license-icon iconfont"></div>
  </div>



              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2023/03/25/%E7%B3%BB%E7%BB%9F%E9%85%8D%E7%BD%AE/%E7%BC%96%E7%A8%8B%E9%85%8D%E7%BD%AE/%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/Hbuilder/hbuilder%E9%85%8D%E7%BD%AE/" title="hbuilder配置">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">hbuilder配置</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2023/03/22/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80/Vue/Vue2/%E5%88%9B%E5%BB%BAvue%E9%A1%B9%E7%9B%AE/" title="创建Vue项目">
                        <span class="hidden-mobile">创建Vue项目</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="margin-left: -1rem">
    <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>
  </div>
</div>





  



  



  



  



  







    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
       <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
    </div>
  
  
    <div class="statistics">
  
  

  
    
      <span id="busuanzi_container_site_pv" style="display: none">
        总访问量 
        <span id="busuanzi_value_site_pv"></span>
         次
      </span>
    
    
      <span id="busuanzi_container_site_uv" style="display: none">
        总访客数 
        <span id="busuanzi_value_site_uv"></span>
         人
      </span>
    
    
  
</div>

  
  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>




  
    <script  src="/js/img-lazyload.js" ></script>
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.18.2/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init(Object.assign({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      scrollSmooth    : true,
      includeTitleTags: true,
      headingsOffset  : -boardTop,
    }, CONFIG.toc));
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }

    Fluid.events.registerRefreshCallback(function() {
      if ('tocbot' in window) {
        tocbot.refresh();
        var toc = jQuery('#toc');
        if (toc.length === 0 || !tocbot) {
          return;
        }
        if (toc.find('.toc-list-item').length > 0) {
          toc.css('visibility', 'visible');
        }
      }
    });
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.11/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));

    Fluid.events.registerRefreshCallback(function() {
      if ('anchors' in window) {
        anchors.removeAll();
        var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
        var res = [];
        for (var item of el) {
          res.push('.markdown-body > ' + item.trim());
        }
        if (CONFIG.anchorjs.placement === 'left') {
          anchors.options.class = 'anchorjs-link-left';
        }
        anchors.add(res.join(', '));
      }
    });
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script  src="/js/local-search.js" ></script>

  <script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>




  
<script src="//cdn.jsdelivr.net/gh/EmoryHuang/BlogBeautify@1.1/DynamicRibbon.min.js"></script>



<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
